import request from "@/axios";

//图库分类列表接口
export function imageCateList(page = 1, limit = 10) {
  return request.get("/admin/image_class/" + page, {
    params: {
      limit,
    },
  });
}

//图库列表接口
export function imageList(id = 166, page = 1, limit = 10) {
  return request.get("/admin/image_class/" + id + "/image/" + page, {
    params: {
      limit,
    },
  });
}

//增加图库分类
export function imageAddList(name = "卷起来", order = 50) {
  return request.post("/admin/image_class", {
    name,
    order,
  });
}

// 修改图片分类
export function imageChangeList(id = 178, name, order) {
  return request.post("/admin/image_class/" + id, {
    name,
    order,
  });
}

// 删除图库分类
export function imageDeleteList(id = 178) {
  return request.post("/admin/image_class/" + id + "/delete", {
    id,
  });
}

// 图片上传
export function uploadImg(image_class_id = 168, img = []) {
  return request.post("/admin/image/upload", {
    image_class_id,
    img,
  });
}

// // 删除图片
// export function deleteImg(ids = [483]) {
//   return request.post("/admin/image/delete_all", {
//     ids,
//   });
// }

// // 修改图片名称
// export function changImgName(id = 482, name) {
//   return request.post("/admin/image/" + id, {
//     name,
//   });
// }
